import { cloud, default as request } from '@/framework/utils/request'

// 获取订单商品数据
export function getMyOrder(query) {
  return request({
    url: `${cloud.mall}/tModOrder/orderPageList`,
    method: 'get',
    params: query
  })
}

// 获取订单详情
export function getMyOrderDetails(query) {
  return request({
    url: `${cloud.mall}/tModOrder/getOrderDetails`,
    method: 'get',
    params: query
  })
}

// 更改订单收货地址
export function updateAddress(data) {
  return request({
    url: `${cloud.mall}/tModOrder/update`,
    method: 'post',
    data
  })
}

// 修改订单状态
export function updateStatus(data) {
  return request({
    url: `${cloud.mall}/tModOrder/updateStatus`,
    method: 'post',
    data
  })
}

/**
 * @Description: 退款列表 /tModOrderReject/pageForMy
 * @param data
 */
export function getRefundList(data) {
  return request({
    url: `${cloud.mall}/tModOrderReject/pageForMy`,
    method: 'get',
    params: data
  })
}
